package com.yyfax.pay.depository.dao;

import org.apache.ibatis.annotations.Param;

import com.yyfax.pay.depository.domain.FuiouFrozenAppropriate;

/**
 * 划拨预冻结DAO
 * 
 * @author heizq
 * @date 2017-09-05 13:34:54
 * @since v1.0.0
 */
public interface FuiouFrozenAppropriateDao {

	/**
	 * 保存订单
	 * 
	 * @author heizq
	 * @date 2017-11-09 16:54:44
	 * @since v1.0.0
	 * @param record
	 * @return
	 */
	public abstract int insert(FuiouFrozenAppropriate record);

	/**
	 * 根据订单id和商户号查询订单
	 * 
	 * @author heizq
	 * @date 2017-09-02 10:54:23
	 * @since v1.0.0
	 * @param orderId
	 * @param merchantCode
	 * @return
	 */
	public abstract FuiouFrozenAppropriate selectByOrderIdMerchantCode(@Param("orderId") String orderId, @Param("merchantCode") String merchantCode);

	/**
	 * 修改订单状态
	 * 
	 * @author heizq
	 * @date 2017-09-02 11:41:42
	 * @since v1.0.0
	 * @param newState 目标状态
	 * @param orgState 原状态
	 * @param id 订单id
	 * @param udpateTime 更新时间
	 */
	public abstract int updateStateById(@Param("newState") String newState, @Param("orgState") String orgState, @Param("busiId") String busiId,
			@Param("updateTime") String updateTime);

	/**
	 * 更新状态和响应信息
	 * 
	 * @author heizq
	 * @date 2017-09-02 17:22:04
	 * @since v1.0.0
	 * @param newState
	 * @param orgState
	 * @param busiId
	 * @param udpateTime
	 * @param rspCode
	 * @param rspMsg
	 * @return
	 */
	public abstract int updateStateAndRspById(@Param("newState") String newState, @Param("orgState") String orgState, @Param("busiId") String busiId,
			@Param("updateTime") String updateTime, @Param("rspCode") Integer rspCode, @Param("rspMsg") String rspMsg);

	/**
	 * 更新状态
	 * 
	 * @author heizq
	 * @date 2017-09-07 11:33:51
	 * @since v1.0.0
	 * @param newState
	 * @param busiId
	 * @param updateTime
	 * @return
	 */
	public abstract int updateStateByBusiId(@Param("newState") String newState, @Param("busiId") String busiId,
			@Param("updateTime") String updateTime, @Param("rspCode") Integer rspCode, @Param("rspMsg") String rspMsg);

	/**
	 * 更新订单响应码和描述
	 * 
	 * @author heizq
	 * @date 2017-10-03 16:43:27
	 * @since v1.0.0
	 * @param updateTime
	 * @param rspCode 响应码
	 * @param rspMsg 描述
	 * @return
	 */
	public abstract int updateCodeAndMsgByBusiId(@Param("busiId") String busiId, @Param("updateTime") String updateTime,
			@Param("rspCode") Integer rspCode, @Param("rspMsg") String rspMsg);
}